\hypertarget{classUIctr}{}\doxysection{U\+Ictr Class Reference}
\label{classUIctr}\index{UIctr@{UIctr}}


User interface control class.  




{\ttfamily \#include $<$G\+L\+F\+W\+\_\+callbacks.\+h$>$}

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classUIctr_ac7f7359994a2338fb761080d5fd258b4}{U\+Ictr}} (mj\+Model $\ast$model\+In, mj\+Data $\ast$data\+In)
\begin{DoxyCompactList}\small\item\em Construct a new \mbox{\hyperlink{classUIctr}{U\+Ictr}} object. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_a087447123941f53a571a61dc667daafe}{ini\+G\+L\+FW}} ()
\begin{DoxyCompactList}\small\item\em initialize glfw \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_ab1ca66138345f413e29662d2f0d7d07f}{create\+Window}} (const char $\ast$window\+Title, bool save\+Video)
\begin{DoxyCompactList}\small\item\em Create a Window object. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_a19e0f736d7afbf0d186c296dd36306d4}{update\+Scene}} ()
\begin{DoxyCompactList}\small\item\em update the scene and rerender the window \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_a08662b29ecd40b29091da61a6f74f0a9}{Keyboard}} (int key, int scancode, int act, int mods)
\begin{DoxyCompactList}\small\item\em keyboard callback \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_a2e1bb14aeca15e5fe8db238117e92a2c}{Mouse\+\_\+button}} (int button, int act, int mods)
\begin{DoxyCompactList}\small\item\em mouse button callback \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_afe0583a3cfb9dfeef3254cb360dd0c06}{Mouse\+\_\+move}} (double xpos, double ypos)
\begin{DoxyCompactList}\small\item\em mouse move callback \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_af995236b8ef2ccd0140581130c4d4b36}{Scroll}} (double xoffset, double yoffset)
\begin{DoxyCompactList}\small\item\em scroll callback \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_afd0f6da49027175ca125ae8b373ec070}{Close}} ()
\begin{DoxyCompactList}\small\item\em close the glfw and free mujoco sence and context \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classUIctr_ad381cf5b25d24a8fdd9438c9c7162fe1}{enable\+Tracking}} ()
\begin{DoxyCompactList}\small\item\em enable camera tracking mode \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classUIctr_a4bf86b3aed4b26e00e14729c08ac572a}\label{classUIctr_a4bf86b3aed4b26e00e14729c08ac572a}} 
G\+L\+F\+Wwindow $\ast$ \mbox{\hyperlink{classUIctr_a4bf86b3aed4b26e00e14729c08ac572a}{window}}
\begin{DoxyCompactList}\small\item\em glfw window pointer \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_aecff34160dca93bdb2b5e58b523af5fd}\label{classUIctr_aecff34160dca93bdb2b5e58b523af5fd}} 
int \mbox{\hyperlink{classUIctr_aecff34160dca93bdb2b5e58b523af5fd}{keyb}} \{0\}
\begin{DoxyCompactList}\small\item\em key being acted \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_ab9a4496c4dbba5ae3bbca71e0af8f810}\label{classUIctr_ab9a4496c4dbba5ae3bbca71e0af8f810}} 
int {\bfseries motion\+\_\+state} \{0\}
\item 
\mbox{\Hypertarget{classUIctr_a5a93ff3a35e7bcd9578510af831418b4}\label{classUIctr_a5a93ff3a35e7bcd9578510af831418b4}} 
int {\bfseries motion\+\_\+state\+\_\+ex} \{0\}
\item 
\mbox{\Hypertarget{classUIctr_a5248ee47688aaff355b1b4649dc1ed8c}\label{classUIctr_a5248ee47688aaff355b1b4649dc1ed8c}} 
bool \mbox{\hyperlink{classUIctr_a5248ee47688aaff355b1b4649dc1ed8c}{button\+\_\+left}} \{false\}
\begin{DoxyCompactList}\small\item\em whether left button is pressed \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a12a7964c62c00d5eddee3f66d4139324}\label{classUIctr_a12a7964c62c00d5eddee3f66d4139324}} 
bool \mbox{\hyperlink{classUIctr_a12a7964c62c00d5eddee3f66d4139324}{button\+\_\+middle}} \{false\}
\begin{DoxyCompactList}\small\item\em whether middle button is pressed \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a5eafa2363ee4546fd59d7d4e351dfcc6}\label{classUIctr_a5eafa2363ee4546fd59d7d4e351dfcc6}} 
bool \mbox{\hyperlink{classUIctr_a5eafa2363ee4546fd59d7d4e351dfcc6}{button\+\_\+right}} \{false\}
\begin{DoxyCompactList}\small\item\em whether right button is pressed \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a7f99212b42f78d3f07735d9b268e1ad0}\label{classUIctr_a7f99212b42f78d3f07735d9b268e1ad0}} 
bool \mbox{\hyperlink{classUIctr_a7f99212b42f78d3f07735d9b268e1ad0}{run\+Sim}} \{true\}
\begin{DoxyCompactList}\small\item\em whether the simulation is running \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_ac9b7897ff484dbc036f3b1aa86e8ec55}\label{classUIctr_ac9b7897ff484dbc036f3b1aa86e8ec55}} 
bool \mbox{\hyperlink{classUIctr_ac9b7897ff484dbc036f3b1aa86e8ec55}{is\+Continuous}} \{true\}
\begin{DoxyCompactList}\small\item\em whether the simulation is continous or paused \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a0b65b69372d6fc3c9c5174896aef9c16}\label{classUIctr_a0b65b69372d6fc3c9c5174896aef9c16}} 
double \mbox{\hyperlink{classUIctr_a0b65b69372d6fc3c9c5174896aef9c16}{lastx}} \{0\}
\begin{DoxyCompactList}\small\item\em last mouse x-\/position \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a47aff1080ae859c6828ad227da5044c0}\label{classUIctr_a47aff1080ae859c6828ad227da5044c0}} 
double \mbox{\hyperlink{classUIctr_a47aff1080ae859c6828ad227da5044c0}{lasty}} \{0\}
\begin{DoxyCompactList}\small\item\em last mouse y-\/position \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_ad3e801c8f1138be0b706469d0b32cdf3}\label{classUIctr_ad3e801c8f1138be0b706469d0b32cdf3}} 
mj\+Model $\ast$ \mbox{\hyperlink{classUIctr_ad3e801c8f1138be0b706469d0b32cdf3}{mj\+\_\+model}}
\begin{DoxyCompactList}\small\item\em mj model pointer \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classUIctr_a0b86ee20f850f18989d8e19f1d47ab6d}\label{classUIctr_a0b86ee20f850f18989d8e19f1d47ab6d}} 
mj\+Data $\ast$ \mbox{\hyperlink{classUIctr_a0b86ee20f850f18989d8e19f1d47ab6d}{mj\+\_\+data}}
\begin{DoxyCompactList}\small\item\em mj data pointer \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
User interface control class. 

This class mainly to control the window, render and user interaction from mouse and keyboard 

Definition at line 19 of file G\+L\+F\+W\+\_\+callbacks.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classUIctr_ac7f7359994a2338fb761080d5fd258b4}\label{classUIctr_ac7f7359994a2338fb761080d5fd258b4}} 
\index{UIctr@{UIctr}!UIctr@{UIctr}}
\index{UIctr@{UIctr}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{UIctr()}{UIctr()}}
{\footnotesize\ttfamily U\+Ictr\+::\+U\+Ictr (\begin{DoxyParamCaption}\item[{mj\+Model $\ast$}]{model\+In,  }\item[{mj\+Data $\ast$}]{data\+In }\end{DoxyParamCaption})}



Construct a new \mbox{\hyperlink{classUIctr}{U\+Ictr}} object. 


\begin{DoxyParams}{Parameters}
{\em model\+In} & mujoco model pointer \\
\hline
{\em data\+In} & mujoco data pointer \\
\hline
\end{DoxyParams}


Definition at line 10 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References mj\+\_\+data, and mj\+\_\+model.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classUIctr_afd0f6da49027175ca125ae8b373ec070}\label{classUIctr_afd0f6da49027175ca125ae8b373ec070}} 
\index{UIctr@{UIctr}!Close@{Close}}
\index{Close@{Close}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{Close()}{Close()}}
{\footnotesize\ttfamily void U\+Ictr\+::\+Close (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



close the glfw and free mujoco sence and context 



Definition at line 231 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References mj\+\_\+data, and mj\+\_\+model.

\mbox{\Hypertarget{classUIctr_ab1ca66138345f413e29662d2f0d7d07f}\label{classUIctr_ab1ca66138345f413e29662d2f0d7d07f}} 
\index{UIctr@{UIctr}!createWindow@{createWindow}}
\index{createWindow@{createWindow}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{createWindow()}{createWindow()}}
{\footnotesize\ttfamily void U\+Ictr\+::create\+Window (\begin{DoxyParamCaption}\item[{const char $\ast$}]{window\+Title,  }\item[{bool}]{save\+Video }\end{DoxyParamCaption})}



Create a Window object. 


\begin{DoxyParams}{Parameters}
{\em window\+Title} & window tile string \\
\hline
{\em save\+Video} & wherther to recorder the video \\
\hline
\end{DoxyParams}


Definition at line 52 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References mj\+\_\+model, and window.

\mbox{\Hypertarget{classUIctr_ad381cf5b25d24a8fdd9438c9c7162fe1}\label{classUIctr_ad381cf5b25d24a8fdd9438c9c7162fe1}} 
\index{UIctr@{UIctr}!enableTracking@{enableTracking}}
\index{enableTracking@{enableTracking}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{enableTracking()}{enableTracking()}}
{\footnotesize\ttfamily void U\+Ictr\+::enable\+Tracking (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



enable camera tracking mode 



Definition at line 242 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.

\mbox{\Hypertarget{classUIctr_a087447123941f53a571a61dc667daafe}\label{classUIctr_a087447123941f53a571a61dc667daafe}} 
\index{UIctr@{UIctr}!iniGLFW@{iniGLFW}}
\index{iniGLFW@{iniGLFW}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{iniGLFW()}{iniGLFW()}}
{\footnotesize\ttfamily void U\+Ictr\+::ini\+G\+L\+FW (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



initialize glfw 



Definition at line 43 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.

\mbox{\Hypertarget{classUIctr_a08662b29ecd40b29091da61a6f74f0a9}\label{classUIctr_a08662b29ecd40b29091da61a6f74f0a9}} 
\index{UIctr@{UIctr}!Keyboard@{Keyboard}}
\index{Keyboard@{Keyboard}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{Keyboard()}{Keyboard()}}
{\footnotesize\ttfamily void U\+Ictr\+::\+Keyboard (\begin{DoxyParamCaption}\item[{int}]{key,  }\item[{int}]{scancode,  }\item[{int}]{act,  }\item[{int}]{mods }\end{DoxyParamCaption})}



keyboard callback 

press backspace will reset the data press \char`\"{}1\char`\"{} will change motion state 
\begin{DoxyParams}{Parameters}
{\em key} & key being acted \\
\hline
{\em scancode} & \\
\hline
{\em act} & action, eg. press \\
\hline
{\em mods} & press G\+L\+F\+W\+\_\+\+K\+E\+Y\+\_\+\+B\+A\+C\+K\+S\+P\+A\+CE will reset simulation release G\+L\+F\+W\+\_\+\+K\+E\+Y\+\_\+1 will transit between pause and resume the simulation release G\+L\+F\+W\+\_\+\+K\+E\+Y\+\_\+2 will pause the display \\
\hline
\end{DoxyParams}


Definition at line 148 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References is\+Continuous, keyb, mj\+\_\+data, mj\+\_\+model, and run\+Sim.

\mbox{\Hypertarget{classUIctr_a2e1bb14aeca15e5fe8db238117e92a2c}\label{classUIctr_a2e1bb14aeca15e5fe8db238117e92a2c}} 
\index{UIctr@{UIctr}!Mouse\_button@{Mouse\_button}}
\index{Mouse\_button@{Mouse\_button}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{Mouse\_button()}{Mouse\_button()}}
{\footnotesize\ttfamily void U\+Ictr\+::\+Mouse\+\_\+button (\begin{DoxyParamCaption}\item[{int}]{button,  }\item[{int}]{act,  }\item[{int}]{mods }\end{DoxyParamCaption})}



mouse button callback 

update mouse position and react to the mouse button action 
\begin{DoxyParams}{Parameters}
{\em button} & \\
\hline
{\em act} & \\
\hline
{\em mods} & \\
\hline
\end{DoxyParams}


Definition at line 177 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References button\+\_\+left, button\+\_\+middle, button\+\_\+right, lastx, lasty, and window.

\mbox{\Hypertarget{classUIctr_afe0583a3cfb9dfeef3254cb360dd0c06}\label{classUIctr_afe0583a3cfb9dfeef3254cb360dd0c06}} 
\index{UIctr@{UIctr}!Mouse\_move@{Mouse\_move}}
\index{Mouse\_move@{Mouse\_move}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{Mouse\_move()}{Mouse\_move()}}
{\footnotesize\ttfamily void U\+Ictr\+::\+Mouse\+\_\+move (\begin{DoxyParamCaption}\item[{double}]{xpos,  }\item[{double}]{ypos }\end{DoxyParamCaption})}



mouse move callback 

update mouse position and change the camera position for different mouse action 
\begin{DoxyParams}{Parameters}
{\em xpos} & \\
\hline
{\em ypos} & \\
\hline
\end{DoxyParams}


Definition at line 190 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References button\+\_\+left, button\+\_\+middle, button\+\_\+right, lastx, lasty, mj\+\_\+model, and window.

\mbox{\Hypertarget{classUIctr_af995236b8ef2ccd0140581130c4d4b36}\label{classUIctr_af995236b8ef2ccd0140581130c4d4b36}} 
\index{UIctr@{UIctr}!Scroll@{Scroll}}
\index{Scroll@{Scroll}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{Scroll()}{Scroll()}}
{\footnotesize\ttfamily void U\+Ictr\+::\+Scroll (\begin{DoxyParamCaption}\item[{double}]{xoffset,  }\item[{double}]{yoffset }\end{DoxyParamCaption})}



scroll callback 


\begin{DoxyParams}{Parameters}
{\em xoffset} & \\
\hline
{\em yoffset} & \\
\hline
\end{DoxyParams}


Definition at line 225 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References mj\+\_\+model.

\mbox{\Hypertarget{classUIctr_a19e0f736d7afbf0d186c296dd36306d4}\label{classUIctr_a19e0f736d7afbf0d186c296dd36306d4}} 
\index{UIctr@{UIctr}!updateScene@{updateScene}}
\index{updateScene@{updateScene}!UIctr@{UIctr}}
\doxysubsubsection{\texorpdfstring{updateScene()}{updateScene()}}
{\footnotesize\ttfamily void U\+Ictr\+::update\+Scene (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



update the scene and rerender the window 



Definition at line 104 of file G\+L\+F\+W\+\_\+callbacks.\+cpp.



References is\+Continuous, mj\+\_\+data, mj\+\_\+model, run\+Sim, and window.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
G\+L\+F\+W\+\_\+callbacks.\+h\item 
G\+L\+F\+W\+\_\+callbacks.\+cpp\end{DoxyCompactItemize}
